h1 { font-size: 1.5em; }

.track {
  background-color: #aaa;
  position: relative;
  height: 0.5em; width: 10em;
  cursor: pointer; z-index: 0;
}
.handle {
  background-color: red;
  position: absolute;
  height: 1em; width: 0.25em; top: -0.25em;
  cursor: move; z-index: 2;
}
.track.vertical { width: 0.5em; height: 10em; }
.track.vertical .handle { width: 1em; height: 0.25em; top: 0; left: -0.25em; }
.handle.selected { outline: 2px solid black; z-index: 3; }
